package com.stockz.ui.swing.charting.painter.indicator;

import java.awt.Graphics2D;

import com.stockz.ui.swing.charting.display.indicator.SupportResistence;
import com.stockz.ui.swing.charting.model.Line;
import com.stockz.ui.swing.charting.view.StockChartPanelState;

public class SupportResistenceIndicatorPainter{

	public static void paint(Graphics2D g,
			SupportResistence display) {
		StockChartPanelState state = display.getStockChartPanel().getStockChartPanelState();
		double max = state.getMaximumPriceVisible();
		double min = state.getMinimumPriceVisible();
		for(Line line : display.getLines()){
			if(line.getEnd().getPrice() > min && line.getEnd().getPrice() < max
					&& line.getStart().getPrice() > min && line.getStart().getPrice() < max){
				state.getShapeSet().add(line);
			}
		}
	}
}
